package com.sk.myview;

import java.util.ArrayList;

import com.sk.water.R;

import android.R.integer;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;

public class OnOrOff extends LinearLayout {
	private TextView Name, Describe;
	private CheckBox valueSwitch;
	private String name, describe;
	private boolean status;
	private int configid;

	public OnOrOff(Context context) {
		super(context);
		LayoutInflater.from(context).inflate(R.layout.on_off, this);
	}

	public OnOrOff(Context context, AttributeSet attr) {
		super(context, attr);
		LayoutInflater.from(context).inflate(R.layout.on_off, this);
	}
	public void setConfigID(int id){
		configid = id;
	}
	public int getConfigID(){
		return configid;
	}

	public void setName(String arg0) {
		this.name = arg0;
		Name = (TextView) findViewById(R.id.on_off_name);
		Name.setText(name);
	}

	public void setDescribe(String arg0) {
		this.describe = arg0;
		Describe = (TextView) findViewById(R.id.on_off_describe);
		Describe.setText(describe);
	}

	public boolean getStatus() {
		valueSwitch = (CheckBox) findViewById(R.id.on_off_switch);
		status = valueSwitch.isChecked();
		return status;
	}

	
}
